﻿
using System;
 using System.Data;
 using System.Configuration;
 using System.Collections;
 using System.Web;
 using System.Web.Security;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Business
{
    public class ReturnUserDetail
    {
       

        public string ReturnName(Guid Userid)
        {
            string Name = "";

            IDataReader dr = DataAccess.TblUserDetail.FetchByParameter("UserId", Userid);
            if (dr.Read())
            {
                if (dr["Role"].ToString() == "Advisorhoghooghi")
                {
                    Name = dr["Name"].ToString();
                }
                if (dr["Role"].ToString() == "Advisorhaghighi")
                {
                    Name = dr["Name"].ToString() + dr["Family"].ToString();
                }
                dr.Close();
            }
            return Name;
        }

        public string ReturnName(string UserName)
        {
            string Name = "";

            IDataReader dr = DataAccess.TblUserDetail.FetchByParameter("UserName", UserName);
            if (dr.Read())
            {
                if (dr["Role"].ToString() == "Advisorhoghooghi")
                {
                    Name = dr["Name"].ToString();
                }
                if (dr["Role"].ToString() == "Advisorhaghighi")
                {
                    Name = dr["Name"].ToString() + dr["Family"].ToString();
                }
                dr.Close();
            }
            return Name;
        }
    }
}